home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news text
| default
| |
99%
| file
| C++ source text
| default
| |
98%
| file
| C++ source, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 69 78 | 2e 6e 65 74 63 6f 6d 2e |Path: ix|.netcom.|
|00000010| 63 6f 6d 21 6e 65 74 6e | 65 77 73 0a 46 72 6f 6d |com!netn|ews.From|
|00000020| 3a 20 22 50 61 75 6c 20 | 44 2e 20 44 65 52 6f 63 |: "Paul |D. DeRoc|
|00000030| 63 6f 22 20 3c 70 64 65 | 72 6f 63 63 6f 40 69 78 |co" <pde|rocco@ix|
|00000040| 2e 6e 65 74 63 6f 6d 2e | 63 6f 6d 3e 0a 4e 65 77 |.netcom.|com>.New|
|00000050| 73 67 72 6f 75 70 73 3a | 20 63 6f 6d 70 2e 6c 61 |sgroups:| comp.la|
|00000060| 6e 67 2e 63 2b 2b 0a 53 | 75 62 6a 65 63 74 3a 20 |ng.c++.S|ubject: |
|00000070| 52 65 3a 20 63 6f 6e 73 | 74 20 75 73 61 67 65 20 |Re: cons|t usage |
|00000080| 61 73 20 23 64 65 66 69 | 6e 65 0a 44 61 74 65 3a |as #defi|ne.Date:|
|00000090| 20 53 61 74 2c 20 31 37 | 20 46 65 62 20 31 39 39 | Sat, 17| Feb 199|
|000000a0| 36 20 30 34 3a 31 38 3a | 31 36 20 2d 30 35 30 30 |6 04:18:|16 -0500|
|000000b0| 0a 4f 72 67 61 6e 69 7a | 61 74 69 6f 6e 3a 20 4e |.Organiz|ation: N|
|000000c0| 65 74 63 6f 6d 0a 4d 65 | 73 73 61 67 65 2d 49 44 |etcom.Me|ssage-ID|
|000000d0| 3a 20 3c 33 31 32 35 39 | 44 35 38 2e 36 34 45 46 |: <31259|D58.64EF|
|000000e0| 40 69 78 2e 6e 65 74 63 | 6f 6d 2e 63 6f 6d 3e 0a |@ix.netc|om.com>.|
|000000f0| 52 65 66 65 72 65 6e 63 | 65 73 3a 20 3c 34 66 72 |Referenc|es: <4fr|
|00000100| 63 39 33 24 32 73 38 40 | 66 6d 73 75 30 33 2e 66 |c93$2s8@|fmsu03.f|
|00000110| 6d 2e 69 6e 74 65 6c 2e | 63 6f 6d 3e 0a 4e 4e 54 |m.intel.|com>.NNT|
|00000120| 50 2d 50 6f 73 74 69 6e | 67 2d 48 6f 73 74 3a 20 |P-Postin|g-Host: |
|00000130| 69 78 2d 62 73 74 2d 6d | 61 31 2d 31 39 2e 69 78 |ix-bst-m|a1-19.ix|
|00000140| 2e 6e 65 74 63 6f 6d 2e | 63 6f 6d 0a 4d 69 6d 65 |.netcom.|com.Mime|
|00000150| 2d 56 65 72 73 69 6f 6e | 3a 20 31 2e 30 0a 43 6f |-Version|: 1.0.Co|
|00000160| 6e 74 65 6e 74 2d 54 79 | 70 65 3a 20 74 65 78 74 |ntent-Ty|pe: text|
|00000170| 2f 70 6c 61 69 6e 3b 20 | 63 68 61 72 73 65 74 3d |/plain; |charset=|
|00000180| 75 73 2d 61 73 63 69 69 | 0a 43 6f 6e 74 65 6e 74 |us-ascii|.Content|
|00000190| 2d 54 72 61 6e 73 66 65 | 72 2d 45 6e 63 6f 64 69 |-Transfe|r-Encodi|
|000001a0| 6e 67 3a 20 37 62 69 74 | 0a 58 2d 4e 45 54 43 4f |ng: 7bit|.X-NETCO|
|000001b0| 4d 2d 44 61 74 65 3a 20 | 53 61 74 20 46 65 62 20 |M-Date: |Sat Feb |
|000001c0| 31 37 20 20 31 3a 32 34 | 3a 34 32 20 41 4d 20 50 |17 1:24|:42 AM P|
|000001d0| 53 54 20 31 39 39 36 0a | 58 2d 4d 61 69 6c 65 72 |ST 1996.|X-Mailer|
|000001e0| 3a 20 4d 6f 7a 69 6c 6c | 61 20 32 2e 30 62 36 61 |: Mozill|a 2.0b6a|
|000001f0| 20 28 57 69 6e 39 35 3b | 20 49 29 0a 54 6f 3a 20 | (Win95;| I).To: |
|00000200| 54 68 65 6f 64 6f 72 65 | 20 4f 6d 74 7a 69 67 74 |Theodore| Omtzigt|
|00000210| 20 2d 20 4d 50 47 20 4d | 41 50 20 2d 20 46 4f 4c | - MPG M|AP - FOL|
|00000220| 53 4f 4d 20 3c 74 6f 6d | 74 7a 69 67 74 40 66 72 |SOM <tom|tzigt@fr|
|00000230| 78 32 31 35 2e 69 6e 74 | 65 6c 2e 63 6f 6d 3e 0a |x215.int|el.com>.|
|00000240| 0a 54 68 65 6f 64 6f 72 | 65 20 4f 6d 74 7a 69 67 |.Theodor|e Omtzig|
|00000250| 74 20 2d 20 4d 50 47 20 | 4d 41 50 20 2d 20 46 4f |t - MPG |MAP - FO|
|00000260| 4c 53 4f 4d 20 77 72 6f | 74 65 3a 0a 3e 20 0a 3e |LSOM wro|te:.> .>|
|00000270| 20 63 6c 61 73 73 20 66 | 6f 6f 20 7b 0a 3e 20 20 | class f|oo {.> |
|00000280| 20 20 20 70 72 69 76 61 | 74 65 3a 0a 3e 20 20 20 | priva|te:.> |
|00000290| 20 20 20 20 20 20 63 6f | 6e 73 74 20 69 6e 74 20 | co|nst int |
|000002a0| 53 49 5a 45 20 3d 20 31 | 30 3b 0a 3e 20 20 20 20 |SIZE = 1|0;.> |
|000002b0| 20 20 20 20 20 69 6e 74 | 20 61 72 72 61 79 5b 53 | int| array[S|
|000002c0| 49 5a 45 5d 3b 0a 3e 20 | 20 20 20 20 70 75 62 6c |IZE];.> | publ|
|000002d0| 69 63 3a 0a 3e 20 20 20 | 20 20 20 20 20 20 66 6f |ic:.> | fo|
|000002e0| 6f 28 29 3b 0a 3e 20 7d | 3b 0a 3e 20 0a 3e 20 2e |o();.> }|;.> .> .|
|000002f0| 2e 2e 20 49 66 20 79 6f | 75 20 74 68 65 6e 20 74 |.. If yo|u then t|
|00000300| 72 79 20 74 6f 20 75 73 | 65 20 74 68 65 20 66 6f |ry to us|e the fo|
|00000310| 6f 20 62 6c 61 20 3a 20 | 53 49 5a 45 28 31 30 29 |o bla : |SIZE(10)|
|00000320| 0a 3e 20 73 74 79 6c 65 | 20 74 6f 20 69 6e 69 74 |.> style| to init|
|00000330| 69 61 6c 69 7a 65 20 74 | 68 65 20 63 6f 6e 73 74 |ialize t|he const|
|00000340| 20 69 6e 74 20 53 49 5a | 45 20 74 68 65 6e 20 79 | int SIZ|E then y|
|00000350| 6f 75 20 72 75 6e 20 69 | 6e 20 74 68 65 0a 3e 20 |ou run i|n the.> |
|00000360| 70 72 6f 62 6c 65 6d 20 | 6f 66 20 6e 6f 74 20 62 |problem |of not b|
|00000370| 65 69 6e 67 20 61 62 6c | 65 20 74 6f 20 63 6f 6d |eing abl|e to com|
|00000380| 70 69 6c 65 20 69 6e 74 | 20 61 72 72 61 79 5b 53 |pile int| array[S|
|00000390| 49 5a 45 5d 20 61 70 70 | 72 6f 70 72 69 61 74 65 |IZE] app|ropriate|
|000003a0| 6c 79 2e 0a 3e 20 0a 3e | 20 57 68 61 74 20 69 73 |ly..> .>| What is|
|000003b0| 20 74 68 65 20 70 72 6f | 70 65 72 20 43 2b 2b 20 | the pro|per C++ |
|000003c0| 77 61 79 20 6f 66 20 64 | 6f 69 6e 67 20 74 68 65 |way of d|oing the|
|000003d0| 20 61 62 6f 76 65 3f 0a | 0a 59 6f 75 20 63 61 6e | above?.|.You can|
|000003e0| 27 74 20 64 6f 20 74 68 | 61 74 2e 20 54 68 65 20 |'t do th|at. The |
|000003f0| 73 69 7a 65 20 6f 66 20 | 61 6e 79 20 6f 62 6a 65 |size of |any obje|
|00000400| 63 74 20 6d 75 73 74 20 | 62 65 20 6b 6e 6f 77 61 |ct must |be knowa|
|00000410| 62 6c 65 20 62 79 20 69 | 74 73 20 74 79 70 65 2c |ble by i|ts type,|
|00000420| 20 0a 61 6e 64 20 73 6f | 20 74 68 65 20 73 69 7a | .and so| the siz|
|00000430| 65 20 6f 66 20 61 20 66 | 6f 6f 20 69 73 20 6c 61 |e of a f|oo is la|
|00000440| 72 67 65 20 65 6e 6f 75 | 67 68 20 74 6f 20 68 6f |rge enou|gh to ho|
|00000450| 6c 64 20 74 68 65 20 61 | 72 72 61 79 20 77 69 74 |ld the a|rray wit|
|00000460| 68 20 74 65 6e 20 0a 65 | 6c 65 6d 65 6e 74 73 2c |h ten .e|lements,|
|00000470| 20 70 65 72 69 6f 64 2e | 0a 0a 54 68 69 73 20 69 | period.|..This i|
|00000480| 73 20 65 78 61 63 74 6c | 79 20 77 68 61 74 20 74 |s exactl|y what t|
|00000490| 65 6d 70 6c 61 74 65 73 | 20 61 72 65 20 67 6f 6f |emplates| are goo|
|000004a0| 64 20 66 6f 72 2e 0a 0a | 20 20 20 20 74 65 6d 70 |d for...| temp|
|000004b0| 6c 61 74 65 20 3c 69 6e | 74 20 53 49 5a 45 3e 20 |late <in|t SIZE> |
|000004c0| 63 6c 61 73 73 20 66 6f | 6f 20 7b 0a 20 20 20 20 |class fo|o {. |
|000004d0| 70 72 69 76 61 74 65 3a | 0a 20 20 20 20 20 20 20 |private:|. |
|000004e0| 20 69 6e 74 20 61 72 72 | 61 79 5b 53 49 5a 45 5d | int arr|ay[SIZE]|
|000004f0| 3b 0a 20 20 20 20 70 75 | 62 6c 69 63 3a 0a 20 20 |;. pu|blic:. |
|00000500| 20 20 20 20 20 20 66 6f | 6f 28 29 3b 0a 20 20 20 | fo|o();. |
|00000510| 20 7d 3b 0a 0a 54 68 65 | 6e 20 64 65 63 6c 61 72 | };..The|n declar|
|00000520| 65 3a 0a 0a 20 20 20 20 | 66 6f 6f 3c 31 30 3e 20 |e:.. |foo<10> |
|00000530| 62 6c 61 3b 0a 0a 54 68 | 65 72 65 27 73 20 61 6e |bla;..Th|ere's an|
|00000540| 6f 74 68 65 72 20 74 72 | 69 63 6b 20 79 6f 75 20 |other tr|ick you |
|00000550| 63 61 6e 20 70 6c 61 79 | 2c 20 69 6e 20 63 61 73 |can play|, in cas|
|00000560| 65 73 20 77 68 65 72 65 | 20 79 6f 75 20 61 72 65 |es where| you are|
|00000570| 20 67 6f 69 6e 67 20 74 | 6f 20 62 65 20 0a 61 6c | going t|o be .al|
|00000580| 6c 6f 63 61 74 69 6e 67 | 20 74 68 65 20 66 6f 6f |locating| the foo|
|00000590| 20 66 72 6f 6d 20 74 68 | 65 20 68 65 61 70 2c 20 | from th|e heap, |
|000005a0| 62 75 74 20 69 74 27 73 | 20 73 6f 72 74 20 6f 66 |but it's| sort of|
|000005b0| 20 75 6e 2d 43 2b 2b 69 | 73 68 2e 20 59 6f 75 20 | un-C++i|sh. You |
|000005c0| 63 61 6e 20 0a 6f 76 65 | 72 6c 6f 61 64 20 6f 70 |can .ove|rload op|
|000005d0| 65 72 61 74 6f 72 20 6e | 65 77 2c 20 61 6e 64 20 |erator n|ew, and |
|000005e0| 75 73 65 20 74 68 65 20 | 22 70 6c 61 63 65 6d 65 |use the |"placeme|
|000005f0| 6e 74 22 20 73 79 6e 74 | 61 78 20 74 6f 20 70 61 |nt" synt|ax to pa|
|00000600| 73 73 20 61 6e 6f 74 68 | 65 72 20 0a 70 61 72 61 |ss anoth|er .para|
|00000610| 6d 65 74 65 72 20 77 68 | 69 63 68 20 73 65 74 73 |meter wh|ich sets|
|00000620| 20 74 68 65 20 61 72 72 | 61 79 20 73 69 7a 65 3a | the arr|ay size:|
|00000630| 0a 0a 20 20 20 20 63 6c | 61 73 73 20 66 6f 6f 20 |.. cl|ass foo |
|00000640| 7b 0a 20 20 20 20 70 72 | 69 76 61 74 65 3a 0a 20 |{. pr|ivate:. |
|00000650| 20 20 20 20 20 20 20 69 | 6e 74 20 61 72 72 61 79 | i|nt array|
|00000660| 5b 31 5d 3b 0a 20 20 20 | 20 70 75 62 6c 69 63 3a |[1];. | public:|
|00000670| 0a 20 20 20 20 20 20 20 | 20 76 6f 69 64 2a 20 6f |. | void* o|
|00000680| 70 65 72 61 74 6f 72 20 | 6e 65 77 28 73 69 7a 65 |perator |new(size|
|00000690| 5f 74 20 73 2c 20 73 69 | 7a 65 5f 74 20 6e 29 20 |_t s, si|ze_t n) |
|000006a0| 7b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 72 65 |{. | re|
|000006b0| 74 75 72 6e 20 6d 61 6c | 6c 6f 63 28 73 20 2b 20 |turn mal|loc(s + |
|000006c0| 28 6e 20 2d 20 31 29 20 | 2a 20 73 69 7a 65 6f 66 |(n - 1) |* sizeof|
|000006d0| 28 69 6e 74 29 29 3b 0a | 20 20 20 20 20 20 20 20 |(int));.| |
|000006e0| 7d 0a 20 20 20 20 7d 0a | 0a 54 68 65 6e 2c 20 79 |}. }.|.Then, y|
|000006f0| 6f 75 20 63 61 6e 20 73 | 61 79 0a 0a 20 20 20 20 |ou can s|ay.. |
|00000700| 66 6f 6f 2a 20 62 6c 61 | 20 3d 20 6e 65 77 28 31 |foo* bla| = new(1|
|00000710| 30 29 20 66 6f 6f 3b 0a | 0a 61 6e 64 20 74 68 65 |0) foo;.|.and the|
|00000720| 20 6f 76 65 72 6c 6f 61 | 64 65 64 20 6f 70 65 72 | overloa|ded oper|
|00000730| 61 74 6f 72 20 6e 65 77 | 20 77 69 6c 6c 20 67 65 |ator new| will ge|
|00000740| 74 20 74 68 65 20 73 69 | 7a 65 20 6f 66 20 61 20 |t the si|ze of a |
|00000750| 66 6f 6f 20 77 69 74 68 | 20 6f 6e 65 20 0a 65 6c |foo with| one .el|
|00000760| 65 6d 65 6e 74 2c 20 70 | 6c 75 73 20 74 68 65 20 |ement, p|lus the |
|00000770| 64 65 73 69 72 65 64 20 | 6e 75 6d 62 65 72 20 6f |desired |number o|
|00000780| 66 20 65 6c 65 6d 65 6e | 74 73 2c 20 61 6e 64 20 |f elemen|ts, and |
|00000790| 77 69 6c 6c 20 64 6f 20 | 73 6f 6d 65 20 0a 61 72 |will do |some .ar|
|000007a0| 69 74 68 6d 65 74 69 63 | 20 74 6f 20 72 65 74 75 |ithmetic| to retu|
|000007b0| 72 6e 20 61 6e 20 6f 62 | 6a 65 63 74 20 74 68 61 |rn an ob|ject tha|
|000007c0| 74 20 69 73 20 61 63 74 | 75 61 6c 6c 79 20 6c 61 |t is act|ually la|
|000007d0| 72 67 65 72 20 74 68 61 | 6e 20 69 74 73 20 73 74 |rger tha|n its st|
|000007e0| 61 74 69 63 20 0a 74 79 | 70 65 20 77 6f 75 6c 64 |atic .ty|pe would|
|000007f0| 20 73 75 67 67 65 73 74 | 2e 20 54 68 69 73 20 73 | suggest|. This s|
|00000800| 6f 72 74 20 6f 66 20 74 | 68 69 6e 67 20 69 73 20 |ort of t|hing is |
|00000810| 68 61 6e 64 79 20 69 66 | 20 74 68 65 20 6f 62 6a |handy if| the obj|
|00000820| 65 63 74 20 6e 65 65 64 | 73 20 74 6f 20 0a 63 6f |ect need|s to .co|
|00000830| 6e 74 61 69 6e 20 6f 6e | 65 20 76 61 72 69 61 62 |ntain on|e variab|
|00000840| 6c 65 2d 6c 65 6e 67 74 | 68 20 66 69 65 6c 64 2c |le-lengt|h field,|
|00000850| 20 73 75 63 68 20 61 73 | 20 61 20 6e 61 6d 65 20 | such as| a name |
|00000860| 73 74 72 69 6e 67 2c 20 | 61 73 20 69 74 20 0a 65 |string, |as it .e|
|00000870| 6c 69 6d 69 6e 61 74 65 | 73 20 74 68 65 20 6e 65 |liminate|s the ne|
|00000880| 65 64 20 74 6f 20 73 74 | 6f 72 65 20 61 20 70 6f |ed to st|ore a po|
|00000890| 69 6e 74 65 72 20 74 6f | 20 61 20 73 65 70 61 72 |inter to| a separ|
|000008a0| 61 74 65 20 73 74 72 69 | 6e 67 2e 0a 0a 48 6f 70 |ate stri|ng...Hop|
|000008b0| 65 20 74 68 69 73 20 68 | 65 6c 70 73 2e 0a 0a 2d |e this h|elps...-|
|000008c0| 2d 20 0a 0a 43 69 61 6f | 2c 0a 50 61 75 6c 20 44 |- ..Ciao|,.Paul D|
|000008d0| 2e 20 44 65 52 6f 63 63 | 6f 0a |. DeRocc|o. |
+--------+-------------------------+-------------------------+--------+--------+